﻿@model SchoolCommunicationSystem.Models.ChangePasswordViewModel
@{
    ViewBag.Title = "Đổi mật khẩu";
    SCS.Business.MembershipService _membershipServices = new SCS.Business.MembershipService();
    string userName = User.Identity.Name;
    var user = _membershipServices.GetUser(userName);
    if (user.MembershipRoles.FirstOrDefault().roleID == 2)
    {
        Layout = "~/Views/Shared/_ParentsLayout.cshtml";
    }
    else if (user.MembershipRoles.FirstOrDefault().roleID == 3 || user.MembershipRoles.FirstOrDefault().roleID == 4)
    {
        Layout = "~/Views/Shared/_TeacherLayout.cshtml";
    }
    else
    {
        Layout = "~/Views/Shared/_AdminLayout.cshtml";
    }
}

<div id="page-heading">
    <h1>Thay đổi thông tin tài khoản</h1>
</div>
<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4>Thay đổi mật khẩu</h4>
                </div>
                <div class="panel-body">
                    @using (Html.BeginForm("ChangePassword", "Members", FormMethod.Post, new { @class = "form-horizontal" }))
                    {
                        @Html.ValidationSummary(false)
                        @Html.AntiForgeryToken() 
                        <div class="form-group">
                            @Html.Label("Mật khẩu hiện tại", new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.EditorFor(m => m.OldPassword)

                            </div>
                        </div>
                        <div class="form-group">
                            @Html.Label("Mật khẩu mới", new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.EditorFor(m => m.NewPassword)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.Label("Nhập lại mật khẩu mới", new { @class = "col-sm-3 control-label" })
                            <div class="col-sm-6">
                                @Html.EditorFor(m => m.ConfirmPassword)
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-sm-offset-3">
                                <div class="btn-toolbar">
                                    <button class="btn-primary btn" type="submit">Lưu</button>
                                </div>
                            </div>
                        </div>
                      
                    }
                </div>
            </div>
        </div>
    </div>
</div>
